<?php  if (!defined("IS_INITPHP")) exit("Access Denied!");  /* INITPHP Version 1.0 ,Create on 2015-11-04 14:27:39, compiled from ../app/web/template/customer/customer.htm */ ?>
<?php include('../app/data/template_c/layout/header.tpl.php'); ?>

<body>
<div >
	<?php include('../app/data/template_c/layout/sidebar.tpl.php'); ?>
<div class="stl_content">

<table  width="100%" border="0" cellspacing="0" cellpadding="4">
  <tr>
    <td height="20" class="content_title">查看客户数据</td>
  </tr>
  <tr>
    <td height="20" bgcolor="#E7E7E7"><a href="<?php  echo initPHP::url('index|index|run');  ?>" >首页</a> ＞ 客户资料管理</td>
  </tr>
</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30">排序方式：&nbsp;&nbsp;<a href="<?php  echo InitPHP::url('customer|index|customerdata').(isset($addurl['page'])?'/page/'.$addurl['page']:'').'/order/purchase_count';  ?>">购买次数</a>&nbsp;&nbsp;|&nbsp;&nbsp;
    <a href="<?php   echo InitPHP::url('customer|index|customerdata').(isset($addurl['page'])?'/page/'.$addurl['page']:'').'/order/purchase_money';  ?>">消费总额</a></td>
    <td width="150"><a href="<?php  echo InitPHP::url('customer|index|exportdata',$addurl);  ?>">导出数据（excel格式）</a></td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="6" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td width="30" bgcolor="#66FF66">序号</td>
    <td bgcolor="#66FF66">数据来源</td>
    <td bgcolor="#66FF66">用户名</td>
    <td bgcolor="#66FF66">姓名</td>
    <td bgcolor="#66FF66">手机号码</td>
    <td bgcolor="#66FF66">邮箱</td>
    <td bgcolor="#66FF66">所在城市</td>
    <td bgcolor="#66FF66">购买次数</td>
    <td bgcolor="#66FF66">消费总额（元）</td>
    <td bgcolor="#66FF66">纯利润（元）</td>
    <td bgcolor="#66FF66">购买订单</td>
  </tr>
  <?php  foreach($customer_data['customer_data'] as $key => $value){    ?>
  <tr>
    <td bgcolor="#FFFFFF"><?php  echo $value['id'];    ?></td>
    <td bgcolor="#FFFFFF"><?php  echo $value['source'];    ?></td>
    <td bgcolor="#FFFFFF"><a href="<?php  echo initPHP::url('customer|index|customerdetail',array('id'=>$value['id']));  ?>" ><?php  echo $value['account_name'];  ?></a></td>
    <td bgcolor="#FFFFFF"><?php  echo $value['name'];  ?></td>
    <td bgcolor="#FFFFFF"><?php  echo $value['telphone'];  ?></td>
    <td bgcolor="#FFFFFF"><?php  echo $value['email'];  ?></td>
    <td bgcolor="#FFFFFF"><?php  echo $value['city'];  ?></td>
    <td bgcolor="#FFFFFF"><?php  echo $value['purchase_count'];  ?></td>
    <td bgcolor="#FFFFFF"><?php  echo $value['purchase_money'];  ?></td>
    <td bgcolor="#FFFFFF"><span class="STYLE1"><?php  echo $value['purchase_profit'];  ?></span></td>
    <td bgcolor="#FFFFFF"><a href="<?php  echo initPHP::url('customer|orderlist|run',array('id'=>$value['id']));  ?>" >查看详细</a></td>
  </tr>
  <?php   }    ?>
  <tr>
    <td colspan="7" bgcolor="#ECFFEC"><div align="right">总计：</div></td>
    <td bgcolor="#ECFFEC"><strong><?php  echo $customer_data['totle_purchase_count'];    ?></strong></td>
    <td bgcolor="#ECFFEC"><strong><?php  echo $customer_data['totle_purchase_money'];    ?></strong></td>
    <td colspan="2" bgcolor="#ECFFEC"><span class="STYLE1"><?php  echo $customer_data['totle_purchase_profit'];    ?></span></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30">总共<strong><?php  echo $customer_data['count'];  ?></strong>条记录，第
    <?php   for($i=1;$i<=$customer_data['count']/PAGE_NUM+$customer_data['count']%PAGE_NUM==0?0:1;$i++){    ?>
    <a href="<?php  $addurl['page']=$i; echo InitPHP::url('customer|index|customerdata',$addurl);  ?>"><strong><?php   echo $i;    ?></strong></a>
    <?php   if($i != ($customer_data['count']/PAGE_NUM+$customer_data['count']%PAGE_NUM==0?0:1)){    ?>
    &nbsp;&nbsp;&nbsp;&nbsp;
    
    <?php   } }    ?>
     页</td>
    <td width="150">&nbsp;</td>
  </tr>
</table>

</div>

</div>
</body>
<script>
function func(obj){
   obj.innerHTML='好';
}
</script>



</html>